package pers.litao.bit.commons.utils;

import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.Digester;


/**
 * @author 李涛
 * @date 2020-11-15 15:57
 */
public class SHA256Utils {
    private final static String KEY = "20170862113";
    public static String encryption(String password,String phone){
        Digester sha256 = new Digester(DigestAlgorithm.SHA256);
        String digestHex = sha256.digestHex(password + KEY + phone);
        for (int i = 0;i < 15;i++){
            digestHex = sha256.digestHex(digestHex);
        }
        return digestHex;
    }
}
